//package com.demo.project_template.rocketmq;
//
//
//import lombok.extern.slf4j.Slf4j;
//import org.apache.rocketmq.client.producer.SendCallback;
//import org.apache.rocketmq.client.producer.SendResult;
//import org.apache.rocketmq.spring.core.RocketMQTemplate;
//import org.springframework.beans.factory.annotation.Value;
//import org.springframework.messaging.support.MessageBuilder;
//import org.springframework.stereotype.Component;
//
//import javax.annotation.Resource;
//
///**
// * @Classname name = MQProducerService
// * @Version 1.0.0
// * @Date 2023/6/14 15:43
// * @Created by ${Mr.Yao}
// */
//@Slf4j
//@Component
//public class MQProducerService {
//
//    @Value("${rocketmq.producer.sendMessageTimeout}")
//    private Integer messageTimeOut;
//
//    @Value("${rocketmq.producer.topic}")
//    private  String topic;
//
//    // 直接注入使用，用于发送消息到broker服务器
//    @Resource
//    private RocketMQTemplate rocketMqTemplate;
//
//    public SendResult cancelOrder(Integer orderId) {
//        return rocketMqTemplate.syncSend(topic + ":cancelOrder", MessageBuilder.withPayload(orderId).build(),messageTimeOut, 14);
//    }
//}
